#ifndef INTERPRETER_H
#define INTERPRETER_H

#include <map>

#include "sketch.h"

using namespace std;

class Interpreter{
    protected:
        Sketch sketch;
        Scene *scene;
        Modeling* modeling;
        
    public:
        Interpreter();
        ~Interpreter();
        
        void setScene(Scene* _scene);
        
        void setModeling(Modeling* _modeling){
            this->modeling = _modeling;
        }
        
        void setTraceFactory(TraceFactory* factory);
        void addCursor(Cursor &cursor);
        
        virtual  void finishTrace(int id){}
        
        Sketch& getSketch(){return sketch;}
        
        void show(){
            map<int, Trace> &traces = sketch.getTraces();
            printf("Sketch: %i\n\n",traces.size());
            for(map<int, Trace>::iterator it = traces.begin(); it != traces.end(); it++){
                printf("Trace: %i  --->  %i\n",it->first, it->second.size());
            }
        }
};

#endif /* INTERPRETER_H */
